package com.longge;

/**
 * @创建人 xinglongge
 * @创建时间 2021/12/1
 * @描述
 */
public class MaxPower {
    public int maxPower(String s) {
        int max = 0, cur = 0;
        char[] chars = s.toCharArray();
        char preChar = ' ';
        for (char aChar : chars) {
            if (aChar == preChar) {
                cur++;
            } else {
                cur = 0;
            }
            max = Math.max(cur, max);
            preChar = aChar;
        }
        return max;
    }
}
